package com.zmn.oms.third.zhimi.dto;

import io.swagger.annotations.ApiModel;
import lombok.Data;

/**
 * @author sunlife
 * @date:2020/4/27 4:19 下午
 * description: 检验结果
 */
@Data
@ApiModel("校验结果")
public class CheckResultDTO {
    /**
     * 是否是有效的SN码
     */
    private Boolean isEffective;

    /**
     * 是否过期
     */
    private Boolean isNotExpired;

    /**
     * 无效信息
     */
    private String message;

    public CheckResultDTO(Boolean isEffective, Boolean isNotExpired, String message) {
        this.isEffective = isEffective;
        this.isNotExpired = isNotExpired;
        this.message = message;
    }

    public CheckResultDTO() {}

    public static CheckResultDTO success(Boolean isNotExpired) {
        return new CheckResultDTO(true, isNotExpired, "");
    }

    public static CheckResultDTO success() {
        return new CheckResultDTO(true, true, "");
    }

    public static CheckResultDTO fail(String message) {
        return new CheckResultDTO(false, false, message);
    }
}
